package org.xxpay.pay.mq.topic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
import org.xxpay.core.common.constant.MchConstant;
import org.xxpay.core.common.util.MyLog;
import org.xxpay.pay.service.CommonService;

@Component
public class MqTopic4ModifySysConfig {

    private static final MyLog _log = MyLog.getLog(MqTopic4ModifySysConfig.class);

    @Autowired private CommonService commonService;

    /** 接收 更新系统配置项的消息 **/
    @JmsListener(destination = MchConstant.COMMON_MQ_TOPIC.MODIFY_SYS_CONFIG, containerFactory = "jmsListenerContainer")
    public void receive(String msg) {

        _log.info("成功接收更新系统配置的订阅通知, msg={}", msg);
        commonService.sysConfigService.initDBApplicationConfig(msg);
        _log.info("系统配置静态属性已重置");
    }

}
